package com.lagou.edu.utils;


import java.sql.Connection;
import java.sql.DriverManager;

/**
 * @author HZF
 * @date 2020/5/31 9:12
 * @description
 */
public class JDBCConnection {
    private static final String name = "com.mysql.jdbc.Driver";
    private static final String url = "jdbc:mysql://localhost:3306/bank";
    private static final String username = "root";
    private static final String password = "root";
    static Connection connection = null;
    private Connection getConnection(String sql){
        try{
            Class.forName(name);
            connection = DriverManager.getConnection(url, username, password);

        }catch (Exception e){
            e.printStackTrace();
        }
        return connection;
    }
}
